//
//  ZhangdanMingxinTableViewCell.m
//  wangzhe
//
//  Created by 李 佳伟 on 2017/10/19.
//  Copyright © 2017年 李 佳伟. All rights reserved.
//

#import "ZhangdanMingxinTableViewCell.h"
#import "JTCSM.h"
@implementation ZhangdanMingxinTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        CGFloat space = 10;
        CGFloat top = 10;
        CGFloat labelWidth = (KSCREENWidth-2*space)/2;
        CGFloat labelHeight = 30;
        self.typeLabel = [UILabel initWithFrame:CGRectMake(space, top, labelWidth, labelHeight) text:@"提现成功" font:16 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(89, 89, 89, 1) backgroundColor:nil];
        [self.contentView addSubview:self.typeLabel];
        self.timeLabel = [UILabel initWithFrame:CGRectMake(space, KVIEW_Y(self.typeLabel), labelWidth, labelHeight) text:@"2017-01-01 12:00" font:14 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(193, 193, 193, 1) backgroundColor:nil];
        [self.contentView addSubview:self.timeLabel];
        
        self.moneyLabel = [UILabel initWithFrame:CGRectMake(KSCREENWidth/2, top, labelWidth, labelHeight*2) text:@"+52,000,000.00" font:18 textAlignment:NSTextAlignmentRight texcolor:RGBACOLOR(237, 150, 121, 1) backgroundColor:nil];
        [self.contentView addSubview:self.moneyLabel];
        
        [df lineViewWithHeightofTop:KVIEW_Y(self.moneyLabel)+10 superView:self.contentView spacing:-200 color:RGBACOLOR(241, 241, 241, 1) lineHeight:1];
    
    }
    
    return self;
}

- (void)setValueWithZhangDanModel:(ZhangDanModel *)model mytype:(ZhangdanMingxinTableViewCellType)type{
    
    if (type == ZhangdanMingxinTableViewCellDefualt) {
        self.moneyLabel.text = [NSString stringWithFormat:@"%.2f元",[model.total_price floatValue]];
    }else{
        self.moneyLabel.text = [NSString stringWithFormat:@"%.2f元",[model.money floatValue]];
    }
    self.typeLabel.text = model.directions;
    self.timeLabel.text = model.create_time;
    
}

@end
